﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class SourceInteger : PreExpression
{
    internal SourceInteger(SourceNode? parent) : base(parent, SyntaxKinds.Integer)
    {
    }
}


public static partial class NodeFactory
{
    public static SourceInteger CreateSourceInteger(SourceNode source)
    {
        Debug.Assert(source.IsNode(SyntaxKinds.Integer));
        SourceInteger integer = new(null);
        integer.UpdateFrom(source);
        integer.UpdateValue(source.TokenNumberValue);
        integer.SetFlags(source.GetFlags());
        return integer;
    }


    public static SourceInteger CreateSourceInteger(SourceNode? parent, int value)
    {
        SourceInteger integer = new(parent);
        integer.UpdateValue(value);
        return integer;
    }
}